<!DOCTYPE html>
<html lang="en">

<head>
  <title>配置详情</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" type="text/css" href="css/zui.min.css" />
  <link rel="stylesheet" type="text/css" href="css/main.css" />

  <style>
    .frame_statusBar {
      color: #fff;
      padding: 12px 7px;
      border-bottom: 1px solid #eee;
      font-size: 16px;
      background: #05CAE8;
      position: fixed
    }


    .panels {
      padding: 4px
    }

    .panels::-webkit-scrollbar {
      display: none
    }

    .text-center {
      text-align: center
    }

    .control-btn {
      display: flex;
      justify-content: center;
    }

    .sub-title {
      text-align: left;
      color: #e5e5e5;
      font-size: 12px;
      padding: 4px 0px
    }

    .progress {
      margin-bottom: 0px;
      height: 8px;
    }

    .process {
      padding: 4px;
      color: #ada7a7;
      cursor: pointer;
      margin-top: 50px;
    }

    .process.online {
      color: #05b90f;
    }

    #repoHistory li {
      display: flex;
      align-items: center;
    }

    #repoHistory div {
      display: inline-block;
      flex: 1;
      text-align: left;
      margin: 6px 0
    }

    #repoHistory div p:nth-child(1) {
      width: 200px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }
    #repoHistory div p:nth-child(2){
      color: #e5e5e5;
    }
    #repoHistory a{
      cursor: pointer
    }
  </style>
</head>

<body class="frame_wrap qw_windows">
  <div class="frame_statusBar">
    配置详细
    <div class="frame_statusBar_inner" id="statusBar_inner">
      <a class="frame_statusBar_btn frame_statusBar_btn_Close js_statusBar_close" href="javascript:;">
        <span class="frame_statusBar_btn_icon"></span>
      </a>
    </div>
  </div>
  <p class="process" id="process" onclick="checkErlangEnv()" title="游戏进程未检测到">
    <i class="icon icon-circle"></i> GAME
  </p>
  <section class="panels">
    <!--基础信息填写-->
    <div class="panel panel-info">
      <div class="panel-heading">
        基础信息
      </div>
      <div class="panel-body text-center" id="base-info">
        <div class="input-group">
          <span class="input-group-addon">项目路径</span>
          <input type="text" name="remoteWorkDir" class="form-control" placeholder="请填写服务器项目路径">
        </div>
        <br>
        <div class="input-group">
          <span class="input-group-addon">本地路径</span>
          <input type="text" name="localWorkDir" class="form-control" placeholder="请填写本地项目路径">
        </div>
        <br>
        <div class="input-group">
          <span class="input-group-addon">启动脚本</span>
          <input type="text" name="startScript" value="start.sh" class="form-control" placeholder="请填写远程项目启动脚本，默认start.sh">
        </div>
        <br>
      </div>
    </div>
    <!--游戏启动，关闭-->
    <div class="control">
      <div class="panel panel-danger">
        <div class="panel-heading">
          核心操作
        </div>
        <div class="panel-body text-center">
          <div class="btn-group">
            <button type="button" onclick="startServer()" class="btn">
              <i class="icon icon-play-circle"></i> 启动游戏</button>
            <button type="button" onclick="stopServer()" class="btn">
              <i class="icon icon-off"></i> 停止游戏</button>
            <button type="button" id="reboot" class="btn btn-warning">
              <i class="icon icon-globe"></i> 重启主机</button>
          </div>
        </div>
      </div>
    </div>
    <!--游戏版本-->
    <div class="control">
      <div class="panel">
        <div class="panel-heading">
          游戏版本
        </div>
        <div class="panel-body text-center">
          <ul id="repoHistory">
          </ul>
        </div>
      </div>
    </div>
    <!--游戏更新操作-->
    <div class="panel panel-success">
      <div class="panel-heading">
        游戏更新
      </div>
      <div class="panel-body">
        <p class="sub-title">后台</p>
        <div class="btn-group control-btn">
          <button class="btn" type="button" onclick="allUpdataBack()">
            <i class="icon icon-cube-alt"></i> 全量更新</button>
          <button class="btn" type="button" onclick="">
            <i class="icon icon-github"></i> GIT更新</button>
          <button class="btn" type="button" data-toggle="modal" data-target="#sshModal">
            配置SSH</button>
        </div>
        <p class="sub-title">前台</p>
        <div class="btn-group control-btn">
          <div class="btn-group control-btn">
            <button class="btn" type="button" onclick="allUpdataFore()">
              <i class="icon icon-cube-alt"></i> 全量更新</button>
            <button class="btn" type="button" onclick="commit(this)">
              <i class="icon icon-github"></i> GIT更新</button>
          </div>
          <div class="btn-group">
            <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
              更多操作
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu pull-right" role="menu">
              <li>
                <a href="javascript:;" onclick="initLocalForeRepo()">
                  1.<i class="icon icon-stack"></i> 初始化本地仓库</a>
              </li>
              <li>
                <a href="javascript:;" onclick="delLocalRepo()">
                  2.<i class="icon icon-trash"></i> 移除本地仓库</a>
              </li>
              <li>
                <a href="javascript:;" onclick="initRemoteForeRepo()">
                  3.<i class="icon icon-stack"></i> 初始化远程仓库</a>
              </li>
              <li>
                <a href="javascript:;" onclick="delRemoteRepo()">
                  4.<i class="icon icon-trash"></i> 移除远程仓库</a>
              </li>
              <li>
                <a href="javascript:;" onclick="delRemoteDst()">
                  5.<i class="icon icon-trash"></i> 移除远程dst</a>
              </li>
              <li>
                <a href="javascript:;" onclick="singleFore()">
                  6.推送DST包</a>
              </li>
            </ul>
          </div>
        </div>
      </div>

    </div>


    <!--操作进度展示区-->
    <div class="panel">
      <div class="panel-heading">
        操作进度
      </div>
      <div class="panel-body">
        <p class="sub-title" id="progressTitle" style="text-align:center;margin-bottom:4px">暂无操作</p>
        <div style="display:none">
          <p class="sub-title" id="progressNum" style="text-align:center;margin-bottom:4px"></p>
          <div class="progress progress-striped active">
            <div class="progress-bar" id="progress" role="progressbar progress-bar-success" style="width: 0%">
            </div>
          </div>
        </div>

      </div>
    </div>
    <!--日志输出区域-->
    <div class="panel">
      <div class="panel-heading">
        日志输出
      </div>
      <div class="panel-body">
        <div class="operation_stage" style="position:relative;padding-top:0px;bottom:0" id="operationStage">
          <a class="operation_stage_clearLogBtn" id="cleanLog" style="top: -10px;right: -5px;" href="javascript:;">清空日志</a>
          <div class="operation_stage_log" style="padding:0" id="log">
          </div>
        </div>
      </div>
    </div>
  </section>


  <!-- 对话框HTML -->
  <div class="modal fade" id="sshModal">
    <div class="modal-dialog">
      <div class="modal-content">
        <textarea class="form-control" onblur="saveSSH(this)" rows="10" placeholder="请在此处粘贴 id_rsa.pub 中的内容"></textarea>
      </div>
    </div>
  </div>
  <script>
    delete window.exports;
    delete window.module;
  </script>
  <script src="js/jquery.min.js"></script>
  <script src="js/zui.min.js"></script>
  <script src="src/detail.js"></script>
</body>

</html>